package com.agentframework.examples.jinhua;

import com.agentframework.core.environment.EnvironmentEventListener;
import com.agentframework.core.environment.EnvironmentInitEvent;

/**
 * @author wangjun
 **/
public class JinhuaInit implements EnvironmentEventListener<EnvironmentInitEvent> {

    @Override
    public void onEnvironmentEvent(EnvironmentInitEvent event) {
        if (event.getEnvironment() instanceof JinhuaEnvironment jinhuaEnvironment) {
            JinhuaGameState jinhuaGameState = new JinhuaGameState(jinhuaEnvironment);
            jinhuaEnvironment.getJinhuaTool().setGameState(jinhuaGameState);
            jinhuaEnvironment.setJinhuaGameState(jinhuaGameState);
        }
    }

}
